package com.mijie.homi.ns.core.handler;

import org.apache.mina.core.session.IoSession;
import org.springframework.stereotype.Service;

import com.mijie.homi.common.constant.TypeCode;
import com.mijie.homi.common.protocol.HomiProtocol;
import com.mijie.homi.ns.domain.Constants;

@Service
public class LogoutHandler implements Handler {

	
	@Override
	public Object handler(IoSession session, HomiProtocol protocol) {
		String token = (String) session.getAttribute(Constants.KEY_TOKEN);
		if(token!=null){
			session.close(true);
		}
		return null;
	}
	
	
}
